<?php

// ĐƯỜNG DẪN TỚI THƯ MỤC CHỨA FILE INDEX.PHP
defined('BASE_PATH')
    || define('BASE_PATH', realpath(dirname(__FILE__)));

// ĐƯỜNG DẪN TỚI THƯ MỤC PUBLIC
defined('PUBLIC_PATH')
    || define('PUBLIC_PATH', BASE_PATH);
	
// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', PUBLIC_PATH . '/../application');

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));


// ĐƯỜNG DẪN TỚI THƯ MỤC library
defined('LIBRARY_PATH')
|| define('LIBRARY_PATH', PUBLIC_PATH."/../library");
        
defined('HOST_PATH')
    || define('HOST_PATH', $_SERVER['SERVER_NAME']);

    
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    //realpath(APPLICATION_PATH . '/../library'),
    LIBRARY_PATH,
    get_include_path(),
)));


/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();